<?php
/**
 * Created by PhpStorm.
 * User: tsy
 * Date: 2017/6/9
 * Time: 15:42
 */
namespace Admin\Model;
use Think\Model;

class AnRongModel extends Model
{
    protected $trueTableName = 'bypal_impl_title';
    public function delete_anrong_creditdetail($paperNumber){
        $sql="delete t1.*,t2.* from bypal_impl_abnormalcreditdetail t1
            left join bypal_impl_overdues t2 on t1.id=t2.abnc_id
            where t1.paperNumber='$paperNumber'";
        $Model = new \Think\Model();
        $values=$Model->execute($sql);
        return $values;
    }

    public function delete_apply_details($paperNumber){
        $sql="delete from bypal_impl_applyDetails where paperNumber=$paperNumber";
        $Model = new \Think\Model();
        $values=$Model->execute($sql);
        return $values;
    }

    public function delete_black_data($paperNumber){
        $sql="delete from bypal_impl_blackData where paperNumber=$paperNumber";
        $Model = new \Think\Model();
        $values=$Model->execute($sql);
        return $values;
    }

    public function delete_normalCreditDetail($paperNumber){
        $sql="delete from bypal_impl_normalCreditDetail where paperNumber=$paperNumber";
        $Model = new \Think\Model();
        $values=$Model->execute($sql);
        return $values;
    }

    public function delete_queryDetail($paperNumber){
        $sql="delete from bypal_impl_queryDetail where paperNumber=$paperNumber";
        $Model = new \Think\Model();
        $values=$Model->execute($sql);
        return $values;
    }

    public function delete_title($paperNumber){
        $sql="delete from bypal_impl_title where paperNumber=$paperNumber";
        $Model = new \Think\Model();
        $values=$Model->execute($sql);
        return $values;
    }

    public function insert_credit_score($applyId,$paperNumber){
        $count=650;
        $sql="insert into bypal_impl_countcredit(performance_score,performance_message,utilization_score,utilization_message,
        history_score,history_message,enquiry_score,enquiry_message,mix_score,mix_message,count,applyId,paperNumber)
        values('280','','120','','0','','80','','0','','$count','$applyId','$paperNumber')";
        $Model = new \Think\Model();
        $values=$Model->execute($sql);
        return $values;
    }
}